feat: add centralized input validation for forecasters - #10
Merged
Conversation
Collaborator
Author
|
This PR also addresses the empty-model-list suggestion: |
Adds Forecaster.validate_input to catch missing columns, empty DataFrames, and non-positive horizons before model inference. Also rejects FoundationForecast(models=[]) at construction time. Closes #7.
elmartinj
force-pushed
the
feature/input-validation
branch
from
September 7, 2026 18:37
2c46cbd to
f9f35d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7.\n\nAdds
Forecaster.validate_inputto check required columns, non-empty DataFrames, and positive horizons before any model is loaded or API called. Validation is applied inForecaster.cross_validationandMultiModelForecasterMixin._call_models, so both single-model and multi-model entry points fail early with consistent error messages.\n\nAlso rejectsFoundationForecast(models=[])during construction instead of waiting for a forecasting method.